﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace MetaDesigner
{
    /// <summary>
    /// Interaction logic for TextDisplay.xaml
    /// TextDisplay is basically a MessageBox but it has a scroll bar to accomodate large blocks of text.
    /// </summary>
    public partial class TextDisplay : Window
    {
        private TextDisplay()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="TextDisplay"/> class.
        /// </summary>
        /// <param name="title">The title.</param>
        /// <param name="content">The content.</param>
        /// <param name="owner">The owner.</param>
        /// <param name="icon">The icon.</param>
        public TextDisplay(String title, String content, Window owner = null, String icon = null)
        {
            InitializeComponent();
            this.Title = title;
            DisplayTextBox.Text = content;
            this.Owner = owner;
            try
            {
                this.Icon = ((Image)((MainWindow)Owner).FindResource(icon)).Source;
            }
            catch (Exception ex)
            {
                DataModel.Log.Append("TextDisplay Icon Exception: ").Append(ex.Message).AppendLine();
            }
        }
    }
}
